package model;

import common.DataManager;

/**
 * @author Colin
 * Upgrades the players health 
 *
 */
public class HealthUpgrade extends Upgrade{
	
	private static final int INITIAL_UPGRADE_AMOUNT = 50;
	private static final int COST = 800;
	
	private float upgradeAmount;
	
	//HealthUpgrade without player
	public HealthUpgrade(){
		super("Health Upgrade", DataManager.HEALTH_UPGRADE, COST);
		upgradeAmount = INITIAL_UPGRADE_AMOUNT;
	}
	public HealthUpgrade( Player player){
		super("Health Upgrade", DataManager.HEALTH_UPGRADE, COST);
		this.player = player;
		this.upgradeAmount = INITIAL_UPGRADE_AMOUNT;
	}
	
	//Health upgrade with player
	@Override
	public void applyUpgrade() {
		float maxHealth = player.getMaxHealth();
		player.setMaxHealth(maxHealth + upgradeAmount);
		player.setHealth(player.getMaxHealth());
		System.out.println("Player max health is " + player.getMaxHealth());
	}
	@Override
	public String getDescription() {
		return "Increases your maximum amount of health";
	}
}
